You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(wizard): run the install commit in the terminal and offer a retry when hooks block it - #700
From onboarding feedback: the installer looked hung on a project with lefthook pre-commit checks, and after cancelling there was no clear way back into the installer.
The commit looked hung. The wizard's offer to commit the install ran git commit with its output captured. git sends hook output to stderr, so anything lefthook printed, prompts included, went into a buffer, and a slow or interactive hook left a blank screen.
git now gets the terminal directly (stdio: "inherit"), exactly as if the person typed git commit. Hook output, colors and interactive displays render normally. The wizard says the hooks are running before git starts.
Ctrl-C stops git and its hooks, not the wizard. The install and the onboarding prompt survive.
Trade-off: git's error text is no longer captured. On a failure the wizard says its output is above.
A commit that does not go through gets a choice. After a refusal or a Ctrl-C the wizard asks: try again, commit without running git hooks (--no-verify), or leave it. Hooks are the project's rules, so they are skipped only when the person picks that option, never by default.
Cancel messages pointed at init. Both said to run init to try again, but init is the no-prompt install and never opens the installer. They now point at the bare command.
Tests cover a refusal followed by leaving it, an explicit commit without hooks, hooks running again on a retry, the running-hooks message, and the cancel message. The Ctrl-C path was checked by hand: a hook running sleep 30 and a SIGINT to the process group stopped git, and the process reported the commit as stopped and kept going.
Read prior review data (.prior-review.json) — no prior threads/reviews/comments found
Fetch PR diff and metadata
Review packages/cli/src/install/uncommitted.ts
Review packages/cli/src/wizard/steps/commit.ts
Review packages/cli/src/wizard/index.ts
Review test changes
Post final review
Review mode: incremental — read 0 prior review thread(s) before reviewing..prior-review.json held no prior review threads, reviews, or top-level comments beyond the trigger itself, so this is the first substantive review of this PR — the whole diff is assessed fresh below.
Summary
The change is well-scoped and the stated problem (captured stderr hiding hook output/prompts, making the wizard look hung) is fixed correctly: commitInstall now spawns git commit with stdio: "inherit" so hooks render normally, and a refusal or Ctrl-C now routes into a retry/skip-hooks/leave choice instead of a dead end. The init → bare-command wording fix in wizard/index.ts is accurate (confirmed against src/index.ts, which only launches the wizard on a bare, no-flag invocation). Test coverage for the new retry/skip-hooks/message paths is solid and exercises real git + hooks rather than mocking git.
[New] One finding posted inline on packages/cli/src/install/uncommitted.ts (around runInTerminal, line 181): the new SIGINT handler is registered with process.on and only ever cleared when the child's close/error fires, so every SIGINT press during a commit is silently swallowed with no escalation path. This diverges from this codebase's own established convention in packages/cli/src/rules/run-directory.ts (process.once, explicitly letting a second signal fall through to terminate the process). If a hook traps/ignores SIGINT or doesn't die promptly, the person has no way to force-abandon a hung commit via repeated Ctrl-C. Worth considering process.once (or removing the listener after the first signal) to restore that escalation path.
Everything else I looked at — the added.ok error propagation, the retry loop's re-staging on each attempt, the skipHooks gating (only offered once, never offered by default), the cancel-message updates, and the test harness changes (mock select routing for "What now?" prompts, the hook-marker retry test, hasCommit helper) — checked out correctly. No other correctness, security, or clarity issues found in this diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From onboarding feedback: the installer looked hung on a project with lefthook pre-commit checks, and after cancelling there was no clear way back into the installer.
The commit looked hung. The wizard's offer to commit the install ran
git commitwith its output captured. git sends hook output to stderr, so anything lefthook printed, prompts included, went into a buffer, and a slow or interactive hook left a blank screen.stdio: "inherit"), exactly as if the person typedgit commit. Hook output, colors and interactive displays render normally. The wizard says the hooks are running before git starts.A commit that does not go through gets a choice. After a refusal or a Ctrl-C the wizard asks: try again, commit without running git hooks (
--no-verify), or leave it. Hooks are the project's rules, so they are skipped only when the person picks that option, never by default.Cancel messages pointed at
init. Both said to runinitto try again, butinitis the no-prompt install and never opens the installer. They now point at the bare command.Tests cover a refusal followed by leaving it, an explicit commit without hooks, hooks running again on a retry, the running-hooks message, and the cancel message. The Ctrl-C path was checked by hand: a hook running
sleep 30and a SIGINT to the process group stopped git, and the process reported the commit as stopped and kept going.